
#include "epollServer.hpp"
#include <memory>
using namespace epoll_ns;

static void usage(const string& proc)
{
    cerr<< "usage:\n\t" << proc << " port" << endl;
}
string transaction(const string& message)
{
    return "I am epollServer:" + message;
}
// ./epollServer 8080
int main(int argc, char* argv[])
{
    if(argc != 2)
    {
        usage(argv[1]);
        exit(USAGE_ERR);
    }
    uint16_t port = atoi(argv[1]);

    unique_ptr<epollServer> epollsvr(new epollServer(transaction, port));

    epollsvr->initServer();
    epollsvr->start();

    return 0;
}